home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / awt / GraphicsDevice.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  2.4 KB  |  94 lines

  1. package java.awt;
  2.  
  3. import java.awt.image.ColorModel;
  4. import sun.awt.AppContext;
  5.  
  6. public abstract class GraphicsDevice {
  7.    private Window fullScreenWindow;
  8.    private AppContext fullScreenAppContext;
  9.    private final Object fsAppContextLock = new Object();
  10.    private Rectangle windowedModeBounds;
  11.    public static final int TYPE_RASTER_SCREEN = 0;
  12.    public static final int TYPE_PRINTER = 1;
  13.    public static final int TYPE_IMAGE_BUFFER = 2;
  14.  
  15.    protected GraphicsDevice() {
  16.    }
  17.  
  18.    public abstract int getType();
  19.  
  20.    public abstract String getIDstring();
  21.  
  22.    public abstract GraphicsConfiguration[] getConfigurations();
  23.  
  24.    public abstract GraphicsConfiguration getDefaultConfiguration();
  25.  
  26.    public GraphicsConfiguration getBestConfiguration(GraphicsConfigTemplate var1) {
  27.       GraphicsConfiguration[] var2 = this.getConfigurations();
  28.       return var1.getBestConfiguration(var2);
  29.    }
  30.  
  31.    public boolean isFullScreenSupported() {
  32.       return false;
  33.    }
  34.  
  35.    public void setFullScreenWindow(Window var1) {
  36.       if (this.fullScreenWindow != null && this.windowedModeBounds != null) {
  37.          this.fullScreenWindow.setBounds(this.windowedModeBounds);
  38.       }
  39.  
  40.       synchronized(this.fsAppContextLock) {
  41.          if (var1 == null) {
  42.             this.fullScreenAppContext = null;
  43.          } else {
  44.             this.fullScreenAppContext = AppContext.getAppContext();
  45.          }
  46.  
  47.          this.fullScreenWindow = var1;
  48.       }
  49.  
  50.       if (this.fullScreenWindow != null) {
  51.          this.windowedModeBounds = this.fullScreenWindow.getBounds();
  52.          Rectangle var2 = this.getDefaultConfiguration().getBounds();
  53.          this.fullScreenWindow.setBounds(var2.x, var2.y, var2.width, var2.height);
  54.          this.fullScreenWindow.setVisible(true);
  55.          this.fullScreenWindow.toFront();
  56.       }
  57.  
  58.    }
  59.  
  60.    public Window getFullScreenWindow() {
  61.       Window var1 = null;
  62.       synchronized(this.fsAppContextLock) {
  63.          if (this.fullScreenAppContext == AppContext.getAppContext()) {
  64.             var1 = this.fullScreenWindow;
  65.          }
  66.  
  67.          return var1;
  68.       }
  69.    }
  70.  
  71.    public boolean isDisplayChangeSupported() {
  72.       return false;
  73.    }
  74.  
  75.    public void setDisplayMode(DisplayMode var1) {
  76.       throw new UnsupportedOperationException("Cannot change display mode");
  77.    }
  78.  
  79.    public DisplayMode getDisplayMode() {
  80.       GraphicsConfiguration var1 = this.getDefaultConfiguration();
  81.       Rectangle var2 = var1.getBounds();
  82.       ColorModel var3 = var1.getColorModel();
  83.       return new DisplayMode(var2.width, var2.height, var3.getPixelSize(), 0);
  84.    }
  85.  
  86.    public DisplayMode[] getDisplayModes() {
  87.       return new DisplayMode[]{this.getDisplayMode()};
  88.    }
  89.  
  90.    public int getAvailableAcceleratedMemory() {
  91.       return -1;
  92.    }
  93. }
  94.